package EXam.Question15;

import java.util.TreeSet;

public class TestStudent666 {
    public static void main(String[] args) {
        // 1. 创建TreeSet集合，用于存储Student666对象
        TreeSet<Student666> studentSet = new TreeSet<>();
        
        // 2. 实例化6个Student666对象
        Student666 student1 = new Student666("爱迪生", 90, 55);
        Student666 student2 = new Student666("牛顿", 100, 90);
        Student666 student3 = new Student666("拉瓦锡", 70, 100);
        Student666 student4 = new Student666("霍金", 100, 100);
        Student666 student5 = new Student666("伽利略", 60, 85);
        Student666 student6 = new Student666("达尔文", 70, 75);
        
        // 3. 分别将对象添加到集合
        studentSet.add(student1);
        studentSet.add(student2);
        studentSet.add(student3);
        studentSet.add(student4);
        studentSet.add(student5);
        studentSet.add(student6);
        
        // 4. 遍历集合打印所有元素信息
        System.out.println("按总分从高到低排序，总分相同时按物理成绩从高到低排序：");
        for (Student666 student : studentSet) {
            System.out.println(student);
        }
    }
}